package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.domain.ZtfLearningAdmin;
import com.ruoyi.system.mapper.ZtfLearningAdminMapper;
import com.ruoyi.system.service.IZtfLearningAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 学科分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-29
 */
@Service
public class ZtfLearningAdminServiceImpl implements IZtfLearningAdminService
{
    @Autowired
    private ZtfLearningAdminMapper ztfLearningAdminMapper;

    /**
     * 查询学科分类
     * 
     * @param sdId 学科分类主键
     * @return 学科分类
     */
    @Override
    public ZtfLearningAdmin selectZtfLearningAdminBySdId(Long sdId)
    {
        return ztfLearningAdminMapper.selectZtfLearningAdminBySdId(sdId);
    }

    /**
     * 查询学科分类列表
     * 
     * @param ztfLearningAdmin 学科分类
     * @return 学科分类
     */
    @Override
    public List<ZtfLearningAdmin> selectZtfLearningAdminList(ZtfLearningAdmin ztfLearningAdmin)
    {
        return ztfLearningAdminMapper.selectZtfLearningAdminList(ztfLearningAdmin);
    }

    /**
     * 新增学科分类
     * 
     * @param ztfLearningAdmin 学科分类
     * @return 结果
     */
    @Override
    public int insertZtfLearningAdmin(ZtfLearningAdmin ztfLearningAdmin)
    {
        //生成id
        ztfLearningAdmin.setSdId(IdUtils.simpleUUID());
        ztfLearningAdmin.setCreateTime(new Date());
        ztfLearningAdmin.setUpdateTime(new Date());
        return ztfLearningAdminMapper.insertZtfLearningAdmin(ztfLearningAdmin);
    }

    /**
     * 修改学科分类
     * 
     * @param ztfLearningAdmin 学科分类
     * @return 结果
     */
    @Override
    public int updateZtfLearningAdmin(ZtfLearningAdmin ztfLearningAdmin)
    {
        return ztfLearningAdminMapper.updateZtfLearningAdmin(ztfLearningAdmin);
    }

    /**
     * 批量删除学科分类
     * 
     * @param sdIds 需要删除的学科分类主键
     * @return 结果
     */
    @Override
    public int deleteZtfLearningAdminBySdIds(String[] sdIds)
    {
        return ztfLearningAdminMapper.deleteZtfLearningAdminBySdIds(sdIds);
    }

    /**
     * 删除学科分类信息
     * 
     * @param sdId 学科分类主键
     * @return 结果
     */
    @Override
    public int deleteZtfLearningAdminBySdId(String sdId)
    {
        return ztfLearningAdminMapper.deleteZtfLearningAdminBySdId(sdId);
    }
}
